﻿@model WebApplication.Models.ReportSettingsModel
@{
    ViewBag.Title = "ViewReport";
}

@using (Html.BeginForm("GetReportsControls", "Reports", FormMethod.Post))
{
    @Html.Hidden("idReport", Model.IdReport)
    <div>
        <h2>
            @Model.ReportName
        </h2>
        <hr />
    </div>
    <div>
        @foreach (var item in Model.ReportParameters)
        {
            switch (item.DataType)
            {
                case WebApplication.Core.EnumDataTypes.Date:
                    Html.RenderPartial("~/Views/Shared/Controls/_DateControl.cshtml", item);
                    break;
                case WebApplication.Core.EnumDataTypes.Numeric:
                    Html.RenderPartial("~/Views/Shared/Controls/_NumericControl.cshtml", item);
                    break;
                case WebApplication.Core.EnumDataTypes.Symbol:
                    Html.RenderPartial("~/Views/Shared/Controls/_SymbolControl.cshtml", item);
                    break;
                case WebApplication.Core.EnumDataTypes.Server:
                    Html.RenderPartial("~/Views/Shared/Controls/_ServerChooseControl.cshtml", item);
                    break;
                case WebApplication.Core.EnumDataTypes.DeployObject:
                    Html.RenderPartial("~/Views/Shared/Controls/_DeployObjectChooseControl.cshtml", item);
                    break;
                default:
            @: <p class="alert alert-error">Неизвестный тип контрола</p>
                break;

            }

        }
    </div>
    
    <input type="submit" value="Отправить" />
}